You can add characters to upperTable and a matching entry in the same position in lowerTable to localize it to handle language specific characters. This script handles e.g., the special swedish characters ÅÄÖ. The script is probably not compatible with languages such as Japanese, that uses 2-bytes ASCII.